package com.cd.music.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;

/**
 * @author yxl 余秀良
 * @version 1.0
 * @description: 新闻实体类
 * @date 2018年03月06日  下午9:47
 * @address: 四川成都
 */
@Entity
@Table
public class News {
    /**
     * id
     */
    @Id
    @Column(length = 32, nullable = false, unique = true)
    private String id;
    /**
     * 标题
     */
    @Column(length = 200, nullable = false)
    private String title;
    /**
     * 摘要
     */
    @Column(nullable = false)
    private String summary;
    /**
     * 封面图
     */
    @Column(nullable = false, columnDefinition = "longtext not null")
    private String coverImage;
    /**
     * 内容
     */
    @Column(nullable = false, columnDefinition = "longtext not null")
    private String content;
    /**
     * 是否删除
     */
    private boolean isDelete = false;
    /**
     * 时间
     */
    @Column(columnDefinition = "datetime default now()")
    private Date createTime;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getSummary() {
        return summary;
    }

    public void setSummary(String summary) {
        this.summary = summary;
    }

    public String getCoverImage() {
        return coverImage;
    }

    public void setCoverImage(String coverImage) {
        this.coverImage = coverImage;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public boolean isDelete() {
        return isDelete;
    }

    public void setDelete(boolean delete) {
        isDelete = delete;
    }

    public Date getCreateTime() {
        return createTime != null ? (Date) createTime.clone() : null;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime != null ? (Date) createTime.clone() : null;
    }

}
